package com.emep.changzhi.analyse.utils;

import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlEngine;

public class Regulation {

    JexlEngine jexlEngine = null;
    Expression expression = null;

    public Regulation(){
        jexlEngine = new JexlEngine();
    }

    public Boolean createExpression(String condition){
        Boolean result = true;
        Expression exp = jexlEngine.createExpression(condition);
        if (exp == null){
            result = false;
        }
        else{
            expression = exp;
        }
        return result;
    }

    public Expression getExpression() {
        return expression;
    }
}
